package com.sservice.web.controller.admin;

import com.sservice.model.vo.PurchaseOrderLogVo;
import com.sservice.service.service.PurchaseOrderLogService;
import com.sservice.base.entity.dto.ListResult;
import com.sservice.base.entity.dto.Pagination;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/admin/purchaseOrderLog")
public class PurchaseOrderLogController {
    @Autowired
    private PurchaseOrderLogService service;

    @ResponseBody
    @RequestMapping(value = "/query", method = RequestMethod.GET)
    public ListResult query(PurchaseOrderLogVo arg) {

        List<PurchaseOrderLogVo> list_order = service.queryByPage(arg);
        int total = service.queryByCount(arg);
        Pagination page = new Pagination(arg.getPage(), total, arg.getSize());
        ListResult res = new ListResult(true, list_order);
        res.setPage(page);
        return res;
    }
}